package grades

import (
	"fmt"
	"sync"
)

type Students map[int]Student

var (
	students      Students
	studentsMutex sync.Mutex
)

func (s Students) GetByID(id int) (*Student, error) {
	student, ok := s[id]
	if !ok {
		return nil, fmt.Errorf("student with ID %d not found", id)
	}
	return &student, nil
}
